Skip to content

Make CodeBuddy optional across platform model workflows - #1157

Open
Robert0622 wants to merge 11 commits into
mainfrom
codex/optional-codebuddy-runtime
Open

Robert0622 wants to merge 11 commits into
mainfrom
codex/optional-codebuddy-runtime

Conversation

@Robert0622

@Robert0622 Robert0622 commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Let requirement clarification, run evaluation, Bot replies, SOP notification reports, and scheduled AI prompts use the execution account's selected CLI and model. Keep the executor and model as separate controls. Use the personal default when a new selection is omitted.
  • Let users add and manage Git credentials and executor credentials in Personal configuration. Git matches credentials to the repository protocol, host, and port. Keep the existing-subscription entry for runner account login.
  • Save a personal default executor, model, reasoning effort, and approval mode. Refresh Chatbot when credentials change so a deleted executor leaves the selection menu.
  • Support an optional CodeBuddy Base URL in personal and runner execution. A remote runner must be at least 0.11.2 for a custom CodeBuddy URL.
  • Keep CodeBuddy defaults for built-in SOP roles and legacy bare model IDs. SOP roles and static preview steps support selecting other executors. AGENTFLOW_BASELINE_ALIGN_EXECUTOR makes the scheduled baseline resolver configurable.
  • Allow source images and sandbox defaults to omit CodeBuddy. Keep the main branch's WeCom CLI installation and both the existing shared CodeBuddy key and provider-specific integrations.
  • Preserve project permissions and the execution account for report generation, clarification, and scheduled jobs. Restore automatic clarification and evaluation when the model picker loads asynchronously.

See deployment configuration for the optional build flags and baseline override.

Verification

  • Passed the non-browser Go suites, the five real Chromium Go tests, go vet ./..., all 450 Chatbot tests, and all 56 Web console suites. Reran the clarification and evaluation picker cases after the final change.
  • Passed Chromium checks for adding and deleting executor credentials, refreshing Chatbot in the same frame, saving and restoring defaults, opening runner login, adding Git credentials, and editing or clearing the CodeBuddy Base URL. A loopback gateway received and answered the configured CodeBuddy request.
  • Passed the Chromium public cases for preserving a draft while adding ZCode, blocking sends with no credential, and opening the GitHub authorization form.
  • Ran real Codex with a loopback model fixture on a host without CodeBuddy in its execution path. Evaluation, assisted approval, notification reports, Bot replies, and two clarification turns passed.
  • Built an image with CODEBUDDY_PACKAGE= and passed its runtime checks. The image contains Codex, DeepSeek Harness, and WeCom CLI.
  • Ran a single real CodeBuddy iOA chat using deepseek-v4.1-flash. It returned the expected response.
  • Passed the configured-executor menus, SOP readiness, and missing-credential journeys on both the published 0.4.0 image and the source build.

@crispinhu27 crispinhu27 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

审查范围

审查了全部 88 个变更文件(head 9badf65,merge-base d58a85a),重点覆盖:feature picker 新架构(web/app/assistant-models.js bindFeaturePicker)、问题抽屉澄清路径(issue-drawer.js)、运行评测路径(runs.js)、后端 feature_model.go/stream.go/run_eval.go/bot_interactions.go/assistant_notification_report.go/assistant_approval_review.go,以及引擎层 align.go、预览合约 preview_build.go,遥测 otlp.go/hooks.go,tracker 凭据回退。

验证结果

CI 失败均为本 PR 引入,已在本地复现:

  1. issue-drawer-actions.test.mjs not ok 79:在 head 失败(actual='in_progress'),在 merge-base 通过。根因:sendIssueClarification 新增异步 feature picker 门控;测试 fixture 未注册 /api/issues/:id/clarify-models,picker value 为空,函数提前返回。同路径还导致「再问一轮」在生产中静默失败(scratch 测试验证)。

  2. runs-actions.test.mjs:231 TypeError:在 head 失败,在 merge-base 通过。根因:startRunEval 新增异步 #runEvalModelPicker 门控;未 stub catalog,POST 不发送,测试访问 undefined.body 崩溃。同时 model wire 格式从裸 ID 改为 engine:id。

go vet 通过。Go 完整测试因共享机器资源耗尽未能运行(非代码错误)。model-catalog-efforts.test.mjs test 98 在 merge-base 上同样失败,属预存缺陷。

问题

两项已确认 P1 问题,均需在合并前修复(详见行内评论)。Go 测试套件及 tracker 凭据逻辑未完成验证。以上不代表代码没有其他缺陷。

Comment thread web/app/issue-drawer.js Outdated
Comment on lines +411 to +415
const picker=$('#issueDetailBody [data-clarify-model]');
await picker?.modelPickerReady;
if(!picker?.isConnected||state.issueDetailData?.issue?.id!==issueId||issueClarifyJobs.get(issueId)?.attached)return;
const model=picker.querySelector('[data-feature-model]')?.value;
if(!model)return toast('请先选择模型');

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] sendIssueClarification 新增异步 picker 门控导致 CI 失败及「再问一轮」静默中断

触发条件:调用 sendIssueClarification(包括 autoStart 自动触发、「再问一轮」重试路径)时,#issueDetailBody [data-clarify-model] 内的 feature picker 尚未完成 /api/issues/:id/clarify-models 异步加载,或加载后无可用执行器/模型。

影响:函数在 picker?.modelPickerReady resolve 后读取 [data-feature-model].value,值为空则 toast('请先选择模型') 后提前返回,POST 不发送。对用户手动点「发送」尚可接受(有 toast 提示),但自动触发的澄清(openIssueClarification(true) / 「再问一轮」openIssueClarification(false,true))通过 setTimeout(...,0) 触发,picker 此时必然未完成加载,导致整轮澄清静默丢弃。

预期 vs 实际:

  • 预期:发送 chat-clarify POST,clarification.status 最终变为 ready
  • 实际:POST 不发送,状态停留在 in_progress,CI 断言 expected 'ready' got 'in_progress'

复现:

cd webtest && node --test tests/issue-drawer-actions.test.mjs
# not ok 4(head);ok 4(merge-base)

scratch 测试:head「再问一轮」CHAT_CLARIFY_POST=null,base 正常发 POST。

修复方向:自动触发路径应等待 picker 加载完成后再发送,或在 sendIssueClarification 内当 initialMessage 非空(即自动触发)时 bypass 空 picker 检查,改为将 model 解析后追加;测试应补充 /api/issues/:id/clarify-models 路由 fixture。

Comment thread web/app/runs.js Outdated
Comment on lines +1379 to +1383
const picker=$('#runEvalModelPicker');
await picker?.modelPickerReady;
if(!picker?.isConnected||state.runEvalBusy)return;
const model=picker.querySelector('[data-feature-model]')?.value;
if(!model)return toast('请先选择模型');

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] startRunEval 异步 picker 门控:CI runs-actions 测试崩溃,评测在 picker 未就绪时静默失败

触发条件:调用 startRunEval 时 #runEvalModelPicker 尚未完成 bindFeaturePicker 的 catalog 异步加载(/api/assistant/models),picker value 为空。

影响:await picker?.modelPickerReady resolve 后 [data-feature-model].value === '',toast('请先选择模型') 后返回,POST 不发送。测试中 app.router.calls.find(c => c.method === 'POST' && c.path === '/api/runs/run-x/eval') 返回 undefined,访问 .body 抛出 TypeError,CI 中断。

此外,picker 正常加载时发送的 model 值从裸 model-x 变为 codebuddy:model-x(带引擎前缀),测试断言 === 'model-x' 也会失败。

复现:

cd webtest && node --test tests/runs-actions.test.mjs
# not ok 5(head);ok 5(merge-base)

修复方向:测试需补充 /api/assistant/models fixture 并在 startRunEval 前等待 picker 就绪(或通过 app.evaluate 拿到 promise 后 await);同时更新断言接受新的 codebuddy:model-x 格式,或在发送前 strip 引擎前缀(取决于服务器是否要求前缀)。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants